package gazzera.node.core.messages;

import java.io.*;

public class PersonTrustingMe extends Message
{
	public boolean trust = false;
	public String hash = null;
	public String nickname = null;
	public String host = null;
	public int port = 0;
	
	
	
	public PersonTrustingMe(boolean trust, String hash, String nickname, String host, int port)
	{
		super();
		this.trust = trust;
		this.hash = hash;
		this.nickname = nickname;
		this.host = host;
		this.port = port;
	}

	public PersonTrustingMe()
	{
		super();
		
	}

	@Override
	protected void recv(DataInputStream s) throws IOException
	{
		trust = readBoolean(s);
		hash = readString(s);
		nickname = readString(s);
		host = readString(s);
		port = readInt(s);
	}

	@Override
	protected void send(DataOutputStream s) throws IOException
	{
		sendBoolean(s, trust);
		sendString(s, hash);
		sendString(s, nickname);
		sendString(s, host);
		sendInt(s, port);
	}
}
